import { Meta2dData, Options, Pen } from '@meta2d/core';
import { Event } from '@meta2d/core/src/event/event';

/**
 * fileProps 中使用
 */
export interface FiledChildProps {
  storeData: Meta2dData;
  options: Options;
  onStoreDataChange: (key: string, value: any) => void;
  onOptionsChange: (key: string, value: any) => void;
}
/**
 * fileProps 中使用
 */
export interface FileMainProps extends FiledChildProps {
  getCanvasData: () => void;
}

/**
 * penProps 中使用
 */
export interface PenMainProps extends FiledChildProps {
  activePens: Pen[];
  getCanvasData: () => void;
}

/**
 * 只作用于pen
 */
export interface PenChildProps {
  setPenValue: (key: keyof Pen, value: any) => void;
  penOptions: Pen;
}

/**
 * 图元选中事件
 */
export interface PenEventProps {
  item: Event;
  onChange: (key: keyof Event, value: any, index: number) => void;
  remove: (index: number) => void;
  index: number;
}

/**
 * 字体图标接口使用
 */
export interface IconFontResponse {
  id: string;
  name: string;
  font_family: string;
  css_prefix_text: string;
  description: string;
  glyphs: Glyphs[];
}

export interface Glyphs {
  icon_id: string;
  name: string;
  font_class: string;
  unicode: string;
  unicode_decimal: number;
}
